﻿using System;
using Microsoft.EntityFrameworkCore.Migrations;

#nullable disable

namespace HengTong.DataAccess.Migrations
{
    /// <inheritdoc />
    public partial class 调整通知消息路由 : Migration
    {
        /// <inheritdoc />
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropColumn(
                name: "MobilRoute",
                table: "SysNotification");

            migrationBuilder.DropColumn(
                name: "Route",
                table: "SysNotification");

            migrationBuilder.AddColumn<Guid>(
                name: "RouteId",
                table: "SysNotification",
                type: "uniqueidentifier",
                nullable: true);

            migrationBuilder.CreateIndex(
                name: "IX_SysNotification_RouteId",
                table: "SysNotification",
                column: "RouteId");

            migrationBuilder.AddForeignKey(
                name: "FK_SysNotification_SysBillRoute_RouteId",
                table: "SysNotification",
                column: "RouteId",
                principalTable: "SysBillRoute",
                principalColumn: "ID");
        }

        /// <inheritdoc />
        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropForeignKey(
                name: "FK_SysNotification_SysBillRoute_RouteId",
                table: "SysNotification");

            migrationBuilder.DropIndex(
                name: "IX_SysNotification_RouteId",
                table: "SysNotification");

            migrationBuilder.DropColumn(
                name: "RouteId",
                table: "SysNotification");

            migrationBuilder.AddColumn<string>(
                name: "MobilRoute",
                table: "SysNotification",
                type: "nvarchar(512)",
                maxLength: 512,
                nullable: true);

            migrationBuilder.AddColumn<string>(
                name: "Route",
                table: "SysNotification",
                type: "nvarchar(512)",
                maxLength: 512,
                nullable: true);
        }
    }
}
